*******************************************************************************************
* Aarøe, Petersen & Arceneaux 2020
* replication dofile for the results from the US 2015 sample 4
*******************************************************************************************

clear 
set more off

* use the following replication data set
use "Replication dataset for the US 2015 sample 4.dta", replace


*******************************************************************************************
* Recodings
*******************************************************************************************

*pathogen disgust 
alpha q24_1 q24_2 q24_3 q24_4 q24_5 q24_6 q24_7, gen(pathogen)
gen pathogen01=(pathogen-1)/6

* vote in the congressional elections (if election tomorrow) - dichotomous variable
gen votecongress=q25
recode votecongress (1=1) (2=0) 	
replace votecongress=. if votecongress >1
ta votecongress

*party identification
gen pid7=.
replace pid7 = 7 if  PID_q28 ==1
replace pid7 = 6 if  PID_q28 ==2
replace pid7 = 1 if  PID_q29 ==1
replace pid7 = 2 if  PID_q29 ==2
replace pid7 = 3 if  PID_q30 ==2
replace pid7 = 5 if  PID_q30 ==1
replace pid7 = 4 if  PID_q30 ==3 & PID_q27==3
gen pid701=(pid7-1)/6


* social and economic issue preferences using items from the Danish National Election Study
*remove don't know answers on Danish items
recode  q17_1 q17_2 q17_3 q17_4 q17_5 q17_6  q18_1 q18_2 q18_3 q18_4 q18_5 (6=.)
recode  q17_1 q17_2 q17_3 q17_5 (1=5) (2=4) (3=3) (4=2) (5=1), gen (q17_1rq q17_2rq q17_3rq q17_5rq)


gen  q17_1rq01=(q17_1rq-1)/4
gen  q17_2rq01=(q17_2rq-1)/4
gen  q17_3rq01=(q17_3rq-1)/4
gen  q17_5rq01=(q17_5rq-1)/4
gen  q17_401=(q17_4-1)/4
gen  q17_601=(q17_6-1)/4

gen q18_101=(q18_1-1)/4
gen q18_201=(q18_2-1)/4
gen q18_301=(q18_3-1)/4
gen q18_401=(q18_4-1)/4
gen q18_501=(q18_5-1)/4


egen DKsocialissues=rmean(q18_101 q18_201 q18_301 q18_401 q18_501)
alpha q18_101 q18_201 q18_301 q18_401 q18_501

egen DKeconissues=rmean (q17_1rq01 q17_2rq01 q17_3rq01 q17_5rq01 q17_401 q17_601)
alpha q17_1rq01 q17_2rq01 q17_3rq01 q17_5rq01 q17_401 q17_601

* social and economic issue preferences using US items developped based on Treier and Hillygus's previous measure
recode  q16_1 q16_5 q16_11 q16_14 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), gen (q16_1rq q16_5rq q16_11rq q16_14rq)
recode  q16_2 q16_4 q16_8 q16_9 q16_10 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), gen (q16_2rq q16_4rq q16_8rq q16_9rq q16_10rq)

* economic issues
gen q16_2rq01=(q16_2rq-1)/6
gen q16_301=(q16_3-1)/6
gen q16_4rq01=(q16_4rq-1)/6
gen q16_601=(q16_6-1)/6
gen q16_701=(q16_7-1)/6
gen q16_8rq01=(q16_8rq-1)/6
gen q16_9rq01=(q16_9rq-1)/6
gen q16_10rq01=(q16_10rq-1)/6
gen q16_1801=(q16_18-1)/6

*social issues
gen q16_1rq01=(q16_1rq-1)/6
gen q16_5rq01=(q16_5rq-1)/6
gen q16_11rq01=(q16_11rq-1)/6
gen q16_1201=(q16_12-1)/6
gen q16_1301=(q16_13-1)/6
gen q16_14rq01=(q16_14rq-1)/6
gen q16_1501=(q16_15-1)/6
gen q16_1601=(q16_16-1)/6
gen q16_1701=(q16_17-1)/6

egen USsocialissues=rmean(q16_1rq q16_5rq q16_11rq q16_12 q16_13 q16_14rq q16_15 q16_16 q16_17)
alpha q16_1rq q16_5rq q16_11rq q16_12 q16_13 q16_14rq q16_15 q16_16 q16_17 

egen USeconissues=rmean(q16_2rq q16_3 q16_4rq q16_6 q16_7 q16_8rq q16_9rq q16_10rq q16_18) 
alpha q16_2rq q16_3 q16_4rq q16_6 q16_7 q16_8rq q16_9rq q16_10rq q16_18

gen useconissue01=(USeconissues-1)/6
gen ussocialissue01=(USsocialissues-1)/6

sum useconissue01 ussocialissue01 DKeconissues DKsocialissues

* ideological self-placement
gen ideo01 =(q19-1)/6
ta ideo01
cor ideo01 useconissue01 ussocialissue01 DKeconissues DKsocialissues

* control variables
gen female = (gender-1)

gen education01=(educ-1)/5

recode faminc (97=.) (31=.), gen (houseincome)
gen houseincome01=(houseincome-1)/15

gen race5=race
recode race5 (1=1) (2=2) (3=3) (4=4) (5=5) (6=5)(7=5) (8=5)
ta race5

tabulate race5, generate(d)

* big five personality traits
sum q40a q40b q40c q40d q40e q40f q40g q40h q40i q40j

recode q40a q40b q40c q40d q40e q40f q40g q40h /*
*/ (0=10) (1=9) (2=8) (3=7) (4=6) (5=5) (6=4) (7=2) (8=2) (9=1) (10=0)

egen openness=rmean(q40a q40b)
egen conscient=rmean(q40c q40d)
egen extraversion=rmean(q40e q40f)
egen agreeableness= rmean(q40g q40h) 
egen neuroticism=rmean(q40i q40j)
gen openness01=openness/10
gen conscient01=conscient/10
gen extraversion01=extraversion/10
gen agreeableness01=agreeableness/10
gen neuroticism01=neuroticism/10


* the commands below generate the measure of SOI

* q11t q12t q13t were asked as opened questions where the respondents could write how many partners they had had sex with within the last year (q11t), foresaw they wuld have sex with within the next five years (q12t) and how many partners they had had sex with on one and only one occasion (q13t)  
* q11t q12t and q13t correspond to items 1, 2, and 3 in the SOI-measure described in Online Appendix A5
* the text answers that the respondents had written in q11t q12t and q13t were coded into numeric answers using the commands below
* to protect the anonymity of the respondents the public replication dataset contains only only the recoded numeric variables q11trc2 q12trc2 q13trc2

/* mvdecode q9_1 q9_2 q9_3, mv(8)
mvdecode q10, mv(9)

zscore q9_1 q9_2 q9_3 q10

destring q11t, generate(q11trc) force
destring q12t, generate(q12trc) force
destring q13t, generate(q13trc) force
				
replace q11trc=	0 if q11t=="0"
replace q11trc=	1 if q11t=="1"
replace q11trc=	1 if q11t=="1 just my husband"
replace q11trc=	1 if q11t=="1 my boyfriend"
replace q11trc=	1 if q11t=="1 my husband"
replace q11trc=	1 if q11t=="1 my wife"
replace q11trc=	1 if q11t=="1 my wife only"
replace q11trc=	1 if q11t=="1 total - my wife"
replace q11trc=	1 if q11t=="1 wife"
replace q11trc=	1000 if q11t=="1,000"
replace q11trc=	10 if q11t=="10"
replace q11trc=	100 if q11t=="100+"
replace q11trc=	11 if q11t=="11"
replace q11trc=	12 if q11t=="12"
replace q11trc=	15 if q11t=="15"
replace q11trc=	2 if q11t=="2"
replace q11trc=	20 if q11t=="20"
replace q11trc=	25 if q11t=="25"
replace q11trc=	27 if q11t=="27"
replace q11trc=	3 if q11t=="3"
replace q11trc=	30 if q11t=="30"
replace q11trc=	4 if q11t=="4"
replace q11trc=	5 if q11t=="5"
replace q11trc=	6 if q11t=="6"
replace q11trc=	69 if q11t=="69"
replace q11trc=	7 if q11t=="7"
replace q11trc=	8 if q11t=="8"
replace q11trc=	9 if q11t=="9"
replace q11trc=	9000 if q11t=="9000"
replace q11trc=	1 if q11t=="I'm married"
replace q11trc=	0 if q11t=="still virgin and prefer to keep i.."
replace q11trc=	1 if q11t=="My hubby"
replace q11trc=	0 if q11t=="NONE"
replace q11trc=	0 if q11t=="None"
replace q11trc=	0 if q11t=="None/does not apply"
replace q11trc=	1 if q11t=="One"
replace q11trc=	1 if q11t=="Only my husband"
replace q11trc=	1 if q11t=="Only my spouse"
replace q11trc=	1 if q11t=="Only my wife for 25 years"
replace q11trc=	2 if q11t=="Two"
replace q11trc=	0 if q11t=="Zero"
replace q11trc=	1 if q11t=="con mi esposo"
replace q11trc=	. if q11t=="de"
replace q11trc=	. if q11t=="frf"
replace q11trc=	1 if q11t=="husband"
replace q11trc=	1 if q11t=="just my husband"
replace q11trc=	1 if q11t=="just my partner"
replace q11trc=	1 if q11t=="just my wife"
replace q11trc=	1 if q11t=="just one- my husband"
replace q11trc=	1 if q11t=="just with my husband 1"
replace q11trc=	1 if q11t=="my husband"
replace q11trc=	1 if q11t=="my wife"
replace q11trc=	0 if q11t=="never"
replace q11trc=	0 if q11t=="none"
replace q11trc=	0 if q11t=="none have been sex free for 3 years"
replace q11trc=	. if q11t=="not enough"
replace q11trc=	. if q11t=="not many"
replace q11trc=	0 if q11t=="nothing"
replace q11trc=	0 if q11t=="o"
replace q11trc=	1 if q11t=="one"
replace q11trc=	1 if q11t=="one my spouse"
replace q11trc=	1 if q11t=="one, my husband"
replace q11trc=	1 if q11t=="only by husband for 37 years"
replace q11trc=	1 if q11t=="only my wife"
replace q11trc=	1 if q11t=="only one"
replace q11trc=	2 if q11t=="two"
replace q11trc=	0 if q11t=="zero"

replace q12trc=0 if q12t=="0"
replace q12trc=1 if q12t=="1"
replace q12trc=1 if q12t=="1 ( if I am married)"
replace q12trc=1 if q12t=="1 I dont see myself with anyone but m.."
replace q12trc=1 if q12t=="1 just my husband"
replace q12trc=1 if q12t=="1 my husband"
replace q12trc=1 if q12t=="1 my w ife only"
replace q12trc=1 if q12t=="1 or none- losing interest despite of.."
replace q12trc=1 if q12t=="1 total - my w ife"
replace q12trc=1 if q12t=="1 unless we have A 3way ;)"
replace q12trc=1 if q12t=="1, my husband. I am not a pig."
replace q12trc=2 if q12t=="1-2"
replace q12trc=10 if q12t=="10"
replace q12trc=100 if q12t=="100"
replace q12trc=1000 if q12t=="1000"
replace q12trc=100000000000 if q12t=="100000000000"
replace q12trc=11 if q12t=="11"
replace q12trc=12 if q12t=="12"
replace q12trc=15 if q12t=="15"
replace q12trc=17 if q12t=="17"
replace q12trc=1 if q12t=="1?"
replace q12trc=2 if q12t=="2"
replace q12trc=4 if q12t=="2-4"
replace q12trc=20 if q12t=="20"
replace q12trc=20000 if q12t=="20,000"
replace q12trc=25 if q12t=="25"
replace q12trc=3 if q12t=="3"
replace q12trc=30 if q12t=="30"
replace q12trc=35 if q12t=="35"
replace q12trc=4 if q12t=="4"
replace q12trc=40 if q12t=="40"
replace q12trc=5 if q12t=="5"
replace q12trc=5 if q12t=="5 d ifferent partners"
replace q12trc=50 if q12t=="50"
replace q12trc=6 if q12t=="6"
replace q12trc=7 if q12t=="7"
replace q12trc=8 if q12t=="8"
replace q12trc=80 if q12t=="80"
replace q12trc=9 if q12t=="9"
replace q12trc=. if q12t=="?"
replace q12trc=. if q12t=="Don't Know"
replace q12trc=. if q12t=="I don't believe in sex outside of mar.."
replace q12trc=. if q12t=="I don't see that love my husband"
replace q12trc=1 if q12t=="Just my husband"
replace q12trc=1 if q12t=="Just my spouse"
replace q12trc=1 if q12t=="Maybe one, but I have been celibate f.."
replace q12trc=1 if q12t=="My spouse"
replace q12trc=0 if q12t=="NONE"
replace q12trc=0 if q12t=="None"
replace q12trc=1 if q12t=="ONE"
replace q12trc=1 if q12t=="One"
replace q12trc=1 if q12t=="One,  if I am married to him."
replace q12trc=1 if q12t=="Only my husband"
replace q12trc=2 if q12t=="Two"
replace q12trc=. if q12t=="Who knows"
replace q12trc=0 if q12t=="Zero"
replace q12trc=0 if q12t=="absolutely none, I don't want sex in .."
replace q12trc=. if q12t=="as many as i can"
replace q12trc=1 if q12t=="con mi esposo"
replace q12trc=. if q12t=="doggystile"
replace q12trc=. if q12t=="don't know"
replace q12trc=. if q12t=="dont know"
replace q12trc=. if q12t=="ff"
replace q12trc=1 if q12t=="husband"
replace q12trc=1 if q12t=="in less i am married none"
replace q12trc=1 if q12t=="just my spouse"
replace q12trc=1 if q12t=="just my wife"
replace q12trc=1 if q12t=="just one"
replace q12trc=1 if q12t=="maybe 1"
replace q12trc=1 if q12t=="maybe one if I get married other wise.."
replace q12trc=1 if q12t=="my husband"
replace q12trc=1 if q12t=="my husband only"
replace q12trc=1 if q12t=="my partner only"
replace q12trc=1 if q12t=="my wife"
replace q12trc=. if q12t=="no idea"
replace q12trc=0 if q12t=="no never"
replace q12trc=0 if q12t=="none"
replace q12trc=. if q12t=="not enough"
replace q12trc=. if q12t=="not sure"
replace q12trc=0 if q12t=="nothing"
replace q12trc=0 if q12t=="o"
replace q12trc=1 if q12t=="one"
replace q12trc=2 if q12t=="one maybe two"
replace q12trc=1 if q12t=="one my wife"
replace q12trc=1 if q12t=="one, my husband"
replace q12trc=1 if q12t=="only my husban"
replace q12trc=1 if q12t=="only my wife"
replace q12trc=1 if q12t=="only one"
replace q12trc=3 if q12t=="three"
replace q12trc=2 if q12t=="two"
replace q12trc=. if q12t=="w emn"
replace q12trc=0 if q12t=="zero"


replace q13trc = 0 if q13t == ".0"
replace q13trc = 10 if q13t == "10 +"
replace q13trc = 15 if q13t =="10-15"
replace q13trc = 3 if q13t == "2 or 3"
replace q13trc = 20 if q13t == "20 plus"
replace q13trc = 25 if q13t == "25-maybe more"
replace q13trc = 4 if q13t == "3 or 4"
replace q13trc = 6 if q13t == "5-6"
replace q13trc = 30 if q13t == "Around 30"
replace q13trc = 50 if q13t == "Before marriage - between 35 - 50"
replace q13trc = 4 if q13t =="Four"
replace q13trc = 10 if q13t =="I can't remember, but maybe around 10?"
replace q13trc = 0 if q13t =="NONE"
replace q13trc = 0 if q13t =="None"
replace q13trc = 1 if q13t =="One"
replace q13trc = 0 if q13t =="Zero"
replace q13trc = 1 if q13t =="`1"
replace q13trc = 100 if q13t == "about 100"
replace q13trc = 5 if q13t =="five"
replace q13trc = 4 if q13t =="four"
replace q13trc = 0 if q13t =="none"
replace q13trc = 0 if q13t =="nothing"
replace q13trc = 1 if q13t =="one"
replace q13trc = 7 if q13t =="seven"
replace q13trc = 6 if q13t =="six"
replace q13trc = 0 if q13t =="still a virgin, so none"
replace q13trc = 10 if q13t =="ten"
replace q13trc = 2 if q13t =="two"
replace q13trc = 0 if q13t =="zero"


gen q11trc2=q11trc
replace q11trc2=9 if q11trc2>9
replace q11trc2=. if q11trc==.

gen q12trc2=q12trc
replace q12trc2=15 if q12trc2>15
replace q12trc2=. if q12trc==.

gen q13trc2=q13trc
replace q13trc2=15 if q13trc2>15
replace q13trc2=. if q13trc==.


zscore q11trc2 q12trc2 q13trc2

alpha q9_1 q9_2 q9_3, gen (SOIatt)
zscore SOIatt

alpha z_q11trc2 z_q12trc2 z_q13trc2 z_SOIatt z_q10, gen(SOI) 
summarize SOI
gen SOI_01 = (SOI - r(min))/(r(max) - r(min)) 

summarize SOI_01 */

*****************************************************
* Analyses and descriptive statistics 
*****************************************************

* sample characteristics
sum female
sum age 
ta education
ta faminc
ta race5

eststo clear
estpost tabstat pathogen01, statistics(mean sd N) columns(statistics)
esttab . , cells("mean sd N"), using part_2.rtf, replace
eststo clear

eststo clear
estpost tabstat pid701 votecongress, statistics(mean sd N) columns(statistics)
esttab . , cells("mean sd N"), using part_2.rtf, replace
eststo clear

eststo clear
estpost tabstat ideo01, statistics(mean sd N) columns(statistics)
esttab . , cells("mean sd N"), using part_2.rtf, replace
eststo clear


* Average marginal effects for Figure 1 in the main text 
* the estimates were included in the dataset for the metaanalysis of effects of pathogen avoidance motivation on party preferences
*party identification
quietly reg pid701 pathogen01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90) 
margins, dydx(pathogen01 education01 houseincome01 openness01 conscient01 agreeableness01) level (90) 

*vote choice
quietly probit votecongress pathogen01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90) 
margins, dydx(pathogen01 education01 houseincome01 openness01 conscient01 agreeableness01) level (90) 


* analyses for Table A10, models 1-2
eststo: reg pid701 pathogen01 female education01 houseincome01 age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90)
eststo: probit votecongress pathogen01 female education01 houseincome01 age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90)
esttab, b(%5.2f) se(%5.2f), using example.rtf, replace onecell star(* 0.1 ** 0.02 *** 0.002) wide constant ar2
eststo clear

* analyses of robustness for figure 2 in the main text reported in the online appendix A3.2
* the estimates from the regression analysis were included in the dataset for the meta-analysis of effects of pathogen avoidance motivation on party preferences 
* marginal effect of education and income using a model in which only gender, age, education and income are included as explanatory variables 


quietly reg pid701 pathogen01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90) 
margins, dydx(pathogen01 education01 houseincome01 openness01 conscient01 agreeableness01) level (90) 

gen miss = e(sample)

quietly reg pid701 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01 if miss ==1, level (90) 
margins, dydx(education01 houseincome01 openness01 conscient01 agreeableness01) level (90) 

quietly reg pid701 female houseincome01 education01  age i.race5 /*
*/if miss ==1, level (90) 
margins, dydx(education01 houseincome01) level (90) 

quietly probit votecongress pathogen01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90)
margins, dydx(pathogen01 education01 houseincome01 openness01 conscient01 agreeableness01) level (90) 

gen miss2=e(sample)
quietly probit votecongress female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01 if miss2 ==1, level (90)
margins, dydx(education01 houseincome01 openness01 conscient01 agreeableness01) level (90) 

quietly probit votecongress female houseincome01 education01  age i.race5 /*
*/ if miss2 ==1, level (90)
margins, dydx(education01 houseincome01) level (90) 


quietly reg pid701 pathogen01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90)

gen miss3 = e(sample)
quietly reg pid701 pathogen01 female houseincome01 education01  age i.race5 /*
*/ if miss3 ==1, level (90) 
margins, dydx(pathogen01) level (90)

quietly probit votecongress pathogen01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90)

gen miss4=e(sample)
quietly probit votecongress pathogen01 female houseincome01 education01  age i.race5 /*
*/ if miss4 ==1, level (90)
margins, dydx(pathogen01) level (90)


*Analyses for Online Appendix A3.3. 
* the estimates were included in the dataset for the meta analysis for the effect of pathogen avoidance motivation on ideological preferences
* avarage marginal effects for Figure A3
eststo clear
eststo: reg ussocialissue01 pathogen01 female education01 houseincome01 age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90)
margins, dydx(pathogen01) level (90)

eststo: reg useconissue01 pathogen01 female education01 houseincome01 age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90)
margins, dydx(pathogen01) level (90)

eststo: reg DKsocialissues pathogen01 female education01 houseincome01 age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90)
margins, dydx(pathogen01) level (90)

eststo: reg DKeconissues pathogen01 female education01 houseincome01 age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90)
margins, dydx(pathogen01) level (90)

eststo: reg ideo01 pathogen01 female education01 houseincome01 age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90)
margins, dydx(pathogen01) level (90)

esttab, b(%5.2f) se(%5.2f), using example.rtf, replace onecell star(* 0.1 ** 0.02 *** 0.002) wide constant ar2
eststo clear

** Decomposition of the correlation between pathogen avoidance motivation and partisanship into a direct and an indirect pathway via social and economic issue preferences


* Analysis for Table 2 in the main text
eststo clear
* model 1
eststo: khb reg pid701 pathogen01 || ussocialissue01 useconissue01, concomitant(female houseincome01 education01 age i.race5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) disentangle level(90)
* model 2
eststo: khb reg pid701 pathogen01 || DKsocialissues DKeconissues, concomitant(female houseincome01 education01 age i.race5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) disentangle level(90)
* model 4
eststo: khb probit votecongress pathogen01 || ussocialissue01 useconissue01, concomitant(female houseincome01 education01 age i.race5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) disentangle level(90)
* model 5
eststo: khb probit votecongress pathogen01 || DKsocialissues DKeconissues, concomitant(female houseincome01 education01 age i.race5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) disentangle level(90)
esttab, b(%5.2f) se(%5.2f), using part_2.rtf, replace onecell star(* 0.1 ** 0.02 *** 0.002) wide constant r2 pr2
eststo clear
* the statistical sigificance of the coefficients for the indirect effect via social issues and economic issues reported in Table 2 were calculated manually (using the coefficients and standard errors from the models above) as this not part of the standard stata output. See the excel spreadsheet "calculation of p-values for indirect effects via social and economic issues Table 2, sample 4"


* Analyses of robustness using the ACME framework reported in Table A16, A3.3.1

* party identification: social issues as a pathway 
medeff (regress ussocialissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01)/*
*/ (regress pid701 ussocialissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (ussocialissue01) treat(pathogen01) sims(1000) seed(1) level (90)
medsens (regress ussocialissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01)/*
*/ (regress pid701 ussocialissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (ussocialissue01) treat(pathogen01) sims(1000) level (90)

medeff (regress DKsocialissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/ (regress pid701 DKsocialissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (DKsocialissues) treat(pathogen01) sims(1000) seed(1) level (90)
medsens (regress DKsocialissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/ (regress pid701 DKsocialissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01), mediate (DKsocialissues) treat(pathogen01) sims(1000) level (90)

* party identification: Econ issues are not a pathway
medeff (regress useconissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/ (regress pid701 useconissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (useconissue01) treat(pathogen01) sims(1000) seed(1) level (90)
medsens (regress useconissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/ (regress pid701 useconissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (useconissue01) treat(pathogen01) sims(1000) level (90)

medeff (regress DKeconissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/ (regress pid701 DKeconissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01), mediate (DKeconissues) treat(pathogen01) sims(1000) seed(1) level (90)
medsens (regress DKeconissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/ (regress pid701 DKeconissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (DKeconissues) treat(pathogen01) sims(1000) level (90)


* Vote choice: social issues as a pathway 
medeff (regress ussocialissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/ (probit votecongress ussocialissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (ussocialissue01) treat(pathogen01) sims(1000) seed(1) level (90)
medsens (regress ussocialissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/ (probit votecongress ussocialissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01), /*
*/ mediate (ussocialissue01) treat(pathogen01) sims(1000) level (90)

medeff (regress DKsocialissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/ (probit votecongress DKsocialissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (DKsocialissues) treat(pathogen01) sims(1000) seed(1) level (90)
medsens (regress DKsocialissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/ (probit votecongress DKsocialissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (DKsocialissues) treat(pathogen01) sims(1000) level (90)

* Vote choice: Econ issues are not a pathway
medeff (regress useconissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/ (probit votecongress useconissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (useconissue01) treat(pathogen01) sims(1000) seed(1) level (90)
medsens (regress useconissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/ (probit votecongress useconissue01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (useconissue01) treat(pathogen01) sims(1000) level (90)

medeff (regress DKeconissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/ (probit votecongress DKeconissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (DKeconissues) treat(pathogen01) sims(1000) seed(1) level (90)
medsens (regress DKeconissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/ (probit votecongress DKeconissues pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (DKeconissues) treat(pathogen01) sims(1000) level (90)

* A3.3.2 Analyses of robustness using alternative measures of social issues 
* Results for Table A18
eststo: khb reg pid701 pathogen01 || ideo01, concomitant(female houseincome01 education01 age i.race5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) disentangle level(90)
esttab, b(%5.2f) se(%5.2f), using part_2.rtf, replace onecell star(* 0.1 ** 0.02 *** 0.002) wide constant r2 pr2
eststo clear

* Results for Table A19
eststo: khb probit votecongress pathogen01 || ideo01, concomitant(female houseincome01 education01 age i.race5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) disentangle level(90)
esttab, b(%5.2f) se(%5.2f), using part_2.rtf, replace onecell star(* 0.1 ** 0.02 *** 0.002) wide constant r2 pr2
eststo clear

* results for Table 3 in the main text. Decomposition of the correlation between pathogen avoidance motivation and social conservative orientation into a direct and an indirect pathway via SOI

eststo clear
eststo: khb reg ussocialissue01 pathogen01 ||  SOI_01, concomitant(female houseincome01 education01 age i.race5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) disentangle level(90)
eststo: khb reg DKsocialissues pathogen01 ||  SOI_01, concomitant(female houseincome01 education01 age i.race5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) disentangle level(90)
eststo: khb reg pid701 pathogen01 || SOI_01, concomitant(female houseincome01 education01 age i.race5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) disentangle level(90)
eststo: khb probit votecongress pathogen01 || SOI_01, concomitant(female houseincome01 education01 age i.race5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) disentangle level(90)
esttab, b(%5.2f) se(%5.2f), using part_2.rtf, replace onecell star(* 0.1 ** 0.02 *** 0.002) wide constant r2 pr2
eststo clear


* results for Appendix A3.4.1 Correlation between SOI and social issue attitudes, party identification, and vote choice
* results for Table A20
reg pid701 pathogen01 SOI_01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90) 
gen miss=e(sample)

eststo: reg pid701 pathogen01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01 if miss ==1, level (90) 
eststo: reg pid701 pathogen01 SOI_01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01 if miss ==1, level (90) 
drop miss


probit votecongress pathogen01 SOI_01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90) 
gen miss=e(sample)

eststo: probit votecongress pathogen01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01 if miss ==1, level (90) 
eststo: probit votecongress pathogen01 SOI_01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01 if miss ==1, level (90) 
drop miss

reg ussocialissue01 pathogen01 SOI_01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90) 
gen miss=e(sample)

eststo: reg ussocialissue01 pathogen01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01 if miss ==1, level (90) 
eststo: reg ussocialissue01 pathogen01 SOI_01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01 if miss ==1, level (90) 
drop miss

reg DKsocialissues pathogen01 SOI_01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90) 
esttab, b(%5.2f) se(%5.2f), using part_2.rtf, replace onecell star(* 0.1 ** 0.02 *** 0.002) wide constant r2 pr2
gen miss=e(sample)

eststo: reg DKsocialissues pathogen01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01 if miss ==1, level (90) 
eststo: reg DKsocialissues pathogen01 SOI_01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01 if miss ==1, level (90) 
esttab, b(%5.2f) se(%5.2f), using part_2.rtf, replace onecell star(* 0.1 ** 0.02 *** 0.002) wide constant r2 pr2
eststo clear
drop miss

* results for A3.4.2 Analysis of robustness using ideological self-placement 
* Results for Table A21: Analysis of robustness: The correlation between SOI and ideological self-placement
reg ideo01 pathogen01 SOI_01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01, level (90) 
gen miss=e(sample)

eststo: reg ideo01 pathogen01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01 if miss ==1, level (90) 
eststo: reg ideo01 pathogen01 SOI_01 female houseincome01 education01  age i.race5 /*
*/openness01 conscient01 extraversion01 agreeableness01 neuroticism01 if miss ==1, level (90) 
esttab, b(%5.2f) se(%5.2f), using part_2.rtf, replace onecell star(* 0.1 ** 0.02 *** 0.002) wide constant r2 pr2
eststo clear
drop miss


* Results for Table A22: Analysis of robustness: Decomposition of the correlation between pathogen avoidance motivation and ideological self-placement into a direct and an indirect pathway via SOI 

eststo: khb reg ideo01 pathogen01 ||  SOI_01, concomitant(female houseincome01 education01 age i.race5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) disentangle level(90)
esttab, b(%5.2f) se(%5.2f), using part_2.rtf, replace onecell star(* 0.1 ** 0.02 *** 0.002) wide constant r2 pr2
eststo clear


* results for A3.4.3. Analysis of robustness of the results in Table 3 using the ACME framework
* results for Table A23: Decomposition of the correlation between pathogen avoidance motivation and social conservative orientation into a direct and an indirect pathway via SOI using the ACME approach 

* with ANES based social issues measure
medeff (regress SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/(regress ussocialissue01 SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (SOI_01) treat(pathogen01) sims(1000) seed(1) level (90)
medsens (regress SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/(regress ussocialissue01 SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (SOI_01) treat(pathogen01) sims(1000) level (90)

* With DNES based social issues measure
medeff (regress SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/(regress DKsocialissues SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (SOI_01) treat(pathogen01) sims(1000) seed(1) level (90)
medsens (regress SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/(regress DKsocialissues SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (SOI_01) treat(pathogen01) sims(1000) level (90)

* With party identification
medeff (regress SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/(regress pid701 SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (SOI_01) treat(pathogen01) sims(1000) seed(1) level (90)
medsens (regress SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/(regress pid701 SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (SOI_01) treat(pathogen01) sims(1000) level (90)

* with vote choice
medeff (regress SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/(probit votecongress SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (SOI_01) treat(pathogen01) sims(1000) seed(1) level (90)
medsens (regress SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/(probit votecongress SOI_01 pathogen01 female houseincome01 education01 age d2 d3 d4 d5 openness01 conscient01 extraversion01 agreeableness01 neuroticism01) /*
*/, mediate (SOI_01) treat(pathogen01) sims(1000) level (90)



